#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    vector<int> v(n);
    vector<int> res(n);
    for(int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    int maxe = *max_element(v.begin(), v.end());
    size_t pos = max_element(v.begin(), v.end()) - v.begin();
    res[pos] = accumulate(v.begin(), v.end(), 0);
    for(int i = 0; i < n; ++i) {
        if(i == pos) continue;
        int gap = maxe - v[i];
        res[i] = res[pos] + 2*gap;
    }
    for(int i = 0; i < n; ++i) {
        cout << res[i] << endl;
    }
}